package semo;/*
class Animal{
    public String name;
    public int age;
    public Animal(String name,int age){
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println(name + "正在吃！");
    }
}

class Bird extends Animal{
    public Bird(String name,int age){
        super(name,age);
    }

    public void fly(){
        System.out.println(name + "正在飞！");
    }
}

class Dog extends Animal{
    public Dog(String name,int age){
        super(name,age);
    }

    public void wangWang(){
        System.out.println(name + "正在汪汪！");
    }

    public void eat(){
        System.out.println(name +"正在吃狗粮");
    }

}
public class Second{
   */
/*public static void main(String[] args) {
       Animal animal2 = new Bird("小鸟",10);
       //animal2.fly();

       //向下转型  但是不安全
       Bird bird = (Bird)animal2;
       bird.fly();


       //报错   类型转换异常
       Animal animal1 = new Dog("小狗",10);
       Bird bird2 = (Bird)animal1;
       bird2.fly();
   }*//*

        }*/
